import React from 'react'
import './OrderDetails.css'
import { Button, WhiteSpace, WingBlank, Modal } from 'antd-mobile';
import Axios from 'axios';
const alert = Modal.alert
const icons = {
    leftReturn: 'iconfont icon-fanhuijian1'
}
export class OrderDetailsPending extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            orderData: []
        }

    }
    componentDidMount() {
        console.log(this.props);
    }
    returnBtn = () => {
        this.props.history.push('/Home/Order')
    }
    orderRefuse = () => {
        const refuse = alert('Delete', '随意拒绝订单会影响您的店铺排名，真的要拒绝吗？', [
            { text: '取消', onPress: () => console.log('取消'), style: 'default' },
            { text: '确定', onPress: () => console.log('确认') }
        ]);
    }
    // 确认接单
    confirmBtn = () => {
        const refuse = alert('确认接单', '接单成功，请尽快制作！', [
            { text: '取消', onPress: () => console.log('取消'), style: 'default' },
            { text: '确定', onPress: () => console.log('确认') }
        ]);
    }
    render() {
        return (
            <div>
                <div className="orderDetailsBox">
                    <div className="PendingTitle">
                        <span className={icons.leftReturn} id="iconSapn" onClick={this.returnBtn}> </span>
                        <h1>待处理订单</h1>
                        <div className="stateBtn">
                            <div className="stateTitle">订单状态：已付款</div>
                        </div>
                        {/* <div className="orderLine">
                            <p>订单号：<span>{this.state.orderData.order_id}</span></p>
                            <p>
                                <span>配送服务</span>
                                <span className="paidBtn">已付款</span>
                            </p>
                        </div> */}
                        {/* {
                            (this.state.orderData || [] || undefined).map((item, index) => {
                                return (
                                    <div className="orderName" key={index}>
                                        <span>{item.goods.goods_name}</span>
                                        <span>{item.goods.goods_num}x{item.goods.goods_price}元</span>
                                    </div>
                                )
                            })
                        } */}

                        <div className="titleBoxOne">
                            <div>
                                <span className="titleLeft">菜品价格</span>
                                <span className="titleRight">12.00元</span>
                                <span className="titleLeft">支付付款</span>
                                <span className="titleRight">12.00元</span>
                                <span className="titleLeft">优惠劵</span>
                                <span className="titleRight">0元</span>
                                <span className="titleLeft">扫码抵扣</span>
                                <span className="titleRight">0元</span>
                                <span className="titleLeft">积分抵扣</span>
                                <span className="titleRight">0元</span>
                                <span className="titleLeft">会员抵扣</span>
                                <span className="titleRight">0元</span>
                                <span className="titleLeft">堂食折扣</span>
                                <span className="titleRight">0元</span>
                                <span className="titleLeft">打包费</span>
                                <span className="titleRight">0元</span>
                                <span className="titleLeft">配送费</span>
                                <span className="titleRight">0元</span>
                            </div>
                        </div>
                        <div className="orderName">
                            <span>买家信息</span>
                        </div>
                        <div className="titleBoxOne">
                            <div>
                                <span className="titleLeft">收货人</span>
                                <span className="titleRight">Evan</span>
                                <span className="titleLeft">电话</span>
                                <span className="titleRight">123456</span>
                                <span className="titleLeft">昵称</span>
                                <span className="titleRight">Evan</span>
                                <span className="titleLeft">地址</span>
                                <span className="titleRight">天河区 棠东东路</span>
                            </div>
                        </div>
                        <div className="orderName">
                            <span>卖家信息</span>
                        </div>
                        <div className="titleBoxOne">
                            <div>
                                <span className="titleLeft">送货人</span>
                                <span className="titleRight">Whaomai</span>
                                <span className="titleLeft">电话</span>
                                <span className="titleRight">123456789</span>
                                <span className="titleLeft">地址</span>
                                <span className="titleRight">天河区 棠东东路</span>
                            </div>
                        </div>
                        <WingBlank>
                            <Button type="ghost" className="refuseBtn" onClick={this.orderRefuse}>拒绝接单</Button><WhiteSpace />
                            <Button type="primary" onClick={this.confirmBtn}>接收订单</Button><WhiteSpace />
                        </WingBlank>
                    </div>
                </div>
            </div>
        )
    }
}
